home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13030 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: hubcap.clemson.edu!hubcap!mjs
  2. From: mjs@hubcap.clemson.edu (M. J. Saltzman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Settle a bet please
  5. Date: 3 Apr 96 19:42:36 GMT
  6. Organization: Clemson University
  7. Message-ID: <mjs.828560556@hubcap>
  8. References: <4jfopb$o9n@news1.sympatico.ca> <4jh8rtINNosd@mayne.ugrad.cs.ubc.ca> <4jp8li$ue@eri2.erinet.com> <828542716snz@genesis.demon.co.uk> <4jufbc$erj@eri.erinet.com>
  9. NNTP-Posting-Host: hubcap.clemson.edu
  10. X-Newsreader: NN version 6.5.0 #1
  11.  
  12. timb@erinet.com (Tim Berens) writes:
  13.  
  14. >Also, even though it is remotely possible that size_t is not the same
  15. >size as an int and that the compiler may not automatically cast it to
  16. >an int for the function call Or that the size of "My name" will exceed
  17. >32K and size_t will be a 2 byte unsigned integer, does it really
  18. >matter in this example?  Can you name a compiler where
  19. >printf("size=%d",sizeof("My Name"));  will not properly display
  20. >"size=8"?
  21.  
  22. I would guess that somewhere in the world, there is an implementation
  23. for a big-endian architecture in which sizeof(size_t) == sizeof(long)
  24. and sizeof(long) > sizeof(int).
  25.  
  26. I think that that would do the trick....
  27.  
  28. Why not just develop the habit of doing it right in the first place?
  29. Otherwise, you're only asking for trouble later on.
  30.  
  31.  
  32.  
  33.  
  34. -- 
  35.         Matthew Saltzman
  36.         Clemson University Math Sciences
  37.         mjs@clemson.edu
  38.